/*
 * ELight.h
 *
 *  Created on: 25-05-2013
 *      Author: Jarek
 */

#ifndef ELIGHT_H_
#define ELIGHT_H_

#include "GlobalData.h"
#include "EVector3.h"
#include "EVector4.h"
#include "EMatrix4x4.h"
#include "ENode.h"
#include "ETime.h"
#include "View.h"

//includes assimp
#include <scene.h>

class Light : public Node, public View
{
public:
	enum LIGHT_TYPE
	{
		LIGHT_TYPE_DIRECTIONAL		= 0,
		LIGHT_TYPE_POINT,
		LIGHT_TYPE_SPOT,


		LIGHT_TYPE_MAX
	} lightType;

	Vector4<float> 		position;
	Vector3<float> 		direction;

	Vector4<float>		ambient;
	Vector4<float>		diffuse;
	Vector4<float> 		specular;

	float 				zFar;
	float 				zNear;

	float				constantAttenuation;
	float				linearAttenuation;
	float				quadraticAttenuation;

	float				spotCutoff;				///< Spot cutoff angle in radians.
	float				spotExponent;
public:
	Light();
	virtual ~Light();

	void						createLight(const aiLight& light);

	Matrix4x4<float> 			getViewMatrix				(const ETime& time);
	virtual Matrix4x4<float> 	getModelViewMatrix (const ETime& time, const Matrix4x4<float>& modelMatrix);
	virtual Matrix4x4<float> 	getModelViewProjectionMatrix(const ETime& time, const Matrix4x4<float>& modelMatrix);
};

#endif /* ELIGHT_H_ */
